package com.example.serviceconsumer.feign;

import org.springframework.stereotype.Component;
import reactivefeign.FallbackFactory;
import reactor.core.publisher.Mono;

/**
 * @author farling-wangp
 * @version 1.0
 * @date 2021/6/5 21:46
 */
public class MyFallbackFactory implements FallbackFactory<ProviderClient> {

    @Override
    public ProviderClient apply(Throwable throwable) {
        return new ProviderClient() {
            @Override
            public Mono<String> hello() {
                return Mono.just("erro");
            }
        };
    }
}

